import * as fs from 'fs-extra';
import { Swagger } from 'src/interface';

export async function localJson(originUrl: string): Promise<Swagger> {
  try {
    const swagger = await fs.readJsonSync(originUrl);
    return swagger;
  } catch (e) {
    throw new Error(e.message);
  }
};
